
<div id="fb-root"></div>
<script>
window.fbAsyncInit = function() {
 FB.init({appId: '162599387114923', status: true, cookie: true, xfbml: true});
 if(typeof fbFinishedInit == 'function') { 
fbFinishedInit(); 
}
 
     /* All the events registered */
     FB.Event.subscribe('auth.login', function(response) {
         login();
     });
     FB.Event.subscribe('auth.logout', function(response) {
         // do something with response
         logout();
     });
 
     FB.getLoginStatus(function(response) {
         if (response.session) {
             // logged in and connected user, someone you know
             login();
         }
     });
 };
 (function() {
        var e = document.createElement('script');
        e.type = 'text/javascript';
        e.src = document.location.protocol +
            '//connect.facebook.net/en_US/all.js';
        e.async = true;
        document.getElementById('fb-root').appendChild(e);
    }());
 </script>